package com.wy.dao;

import com.wy.bean.NoticeBean;
import com.wy.model.sys.NoticeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface NoticeEntityMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(NoticeEntity record);

    int insertSelective(NoticeEntity record);

    NoticeEntity selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(NoticeEntity record);

    int updateByPrimaryKey(NoticeEntity record);

    /**
     * 获取公告列表
     *
     * @param pageSize 每页显示条数
     * @param start 起始页数
     * @return
     */
    List<NoticeBean> noticeList(@Param("pageSize") int pageSize,
                                @Param("start") int start,
                                @Param("content")  String content,
                                @Param("type") String type,
                                @Param("ntype") String ntype,
                                @Param("publishTimeStart") String publishTimeStart,
                                @Param("publishTimeEnd") String publishTimeEnd,
                                @Param("status") String status);


    /**
     * 获取公告列表的总量
     *
     * @param pageSize 每页显示条数
     * @param start 起始页数
     * @return
     */
    Integer noticeSize(@Param("pageSize") int pageSize,
                                @Param("start") int start,
                                @Param("content")  String content,
                                @Param("type") String type,
                                @Param("ntype") String ntype,
                                @Param("publishTimeStart") String publishTimeStart,
                                @Param("publishTimeEnd") String publishTimeEnd,
                                @Param("status") String status);

    int deleteByPrimaryKey(@Param("id")List<String> id);


    /**
     * 获取公告通知信息
     * @return
     */
    List<NoticeEntity> noticeList1(@Param("pageSize")int pageSize,
                                   @Param("start")int start,
                                   @Param("type")String type,
                                   @Param("ntype") String ntype,
                                   @Param("readStatus") String readStatus,
                                   @Param("uid")int uid);

    /**
     * 获取公告列表的总量
     *
     * @return
     */
    Integer noticeSize1(@Param("pageSize")int pageSize,
                        @Param("start")int start,
                        @Param("type")String type,
                        @Param("ntype") String ntype,
                        @Param("readStatus") String readStatus,
                        @Param("uid")int uid);

    /**
     * 根据时间获取未发布的公告
     * @param time
     * @return
     */
    List<NoticeEntity> getNoticeByPublishTime(@Param("time") String time);
}